"use strict";

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = (app) => {
    const { router, controller } = app;
    router.get("/", controller.home.index);
    router.post("/login", controller.home.login);
    router.post("/register", controller.home.register);

    // 添加教室
    router.post("/rooms", controller.room.create);
    router.get("/rooms", controller.room.index);
    router.delete("/rooms/:id", controller.room.remove);

    // 班级管理
    router.post("/grades", controller.grade.create);
    router.get("/grades", controller.grade.index);
    router.put("/grades/:id", controller.grade.update);
    router.delete("/grades/:id", controller.grade.delete);

    // 学生管理
    router.post("/students", controller.student.create);
    router.get("/students", controller.student.index);
    // router.put("/students/:id", controller.student.update);
    // router.delete("/students/:id", controller.student.delete);
};
